SqlConnectionDataProvider Constructor(SqlConnection,ReadOnlyCollection<String>)
Initializes the data provider to access all elements available from the connection that belong to the passed schemas.
Parameters
- connection
- The connection to use.
- tableSchemas
- The list of allowed table schemas.
SqlConnection conn = new SqlConnection(Properties.Settings.Default.ConnectionString);
List<string> schemas = new List<string>();
schemas.Add("Sales");
schemas.Add("HumanResources");
SqlConnectionDataProvider provider = new SqlConnectionDataProvider(conn, schemas.AsReadOnly());
provider.PrefixTableNameWithSchema = true;
LL.DataSource = provider;
LL.Design();
Dim conn As New SqlConnection(Properties.Settings.[Default].ConnectionString)
Dim schemas As New List(Of String)()
schemas.Add("Sales")
schemas.Add("HumanResources")
Dim provider As New SqlConnectionDataProvider(conn, schemas.AsReadOnly())
provider.PrefixTableNameWithSchema = True
LL.DataSource = provider
LL.Design()